import {
  GET_CUSTOMER_FLOW,
  GET_PERCEPTION_ALARM,
  GET_ASSIST_INFO,
  GET_VIDEO_URL,
  GET_REGION_FLOW,
  GET_WAIT_INFO,
  GET_DEVICE_ERROR,
  GET_TRANSFER_FLOW,
  GET_BASE_INFO,
  GET_STATION_FLOW,
  GET_TRAIN_INFO
} from '@/service/api'
import {request, METHOD, removeAuthorization} from '@/utils/request'

// 
export async function videoUrl() {
  return request(GET_VIDEO_URL, METHOD.GET)
}
// 获取故障设备
export async function deviceError() {
  return request(GET_DEVICE_ERROR, METHOD.GET)
}
// 站内实时人数统计
export async function stationFlow() {
  return request(GET_STATION_FLOW, METHOD.GET, {
    time:'2020-01-01 00:00:00'
  })
}
// 换乘客流统计
export async function transferFlow(start,end) {
  return request(GET_TRANSFER_FLOW, METHOD.GET, {
    start: start,
    end: end,
  })
}

// 获取实时客流监测
export async function customerFlow(start,end,interval) {
  return request(GET_CUSTOMER_FLOW, METHOD.GET,{
    start: start,
    end: end,
    interval:interval
  })
}

// 感知报警
export async function perceptionAlarm(number) {
  return request(GET_PERCEPTION_ALARM, METHOD.GET,{
    number:number
  })
}

// 感知报警
export async function regionFlow(number) {
  return request(GET_REGION_FLOW, METHOD.GET,{
    number:number
  })
}
export async function waitInfo(number) {
  return request(GET_WAIT_INFO, METHOD.GET,{
    number:number
  })
}

export async function assistInfo(number) {
  return request(GET_ASSIST_INFO, METHOD.GET,{
    number:number
  })
}

// 获取天气信息
export async function baseInfo(deviceId,direction,station) {
  return request(GET_BASE_INFO, METHOD.GET,{
    deviceId: deviceId,
    direction: direction,
    station:station
  })
}
// 获取ats 列车信息
export async function trainInfo(deviceId,direction,station) {
  return request(GET_TRAIN_INFO, METHOD.GET,{
    deviceId: deviceId,
    direction: direction,
    station:station
  })
}


export default {
  customerFlow,
  perceptionAlarm,
  assistInfo,
  regionFlow,
  waitInfo,
  deviceError,
  videoUrl,
  stationFlow,
  transferFlow,
  trainInfo,
  baseInfo
}